ComponentOne Splitter for ASP.NET Web Forms
Task-Based Help / Changing the Appearance of a C1Splitter Control / Changing Splitter Bar Location
In This Topic
    Changing Splitter Bar Location
    In This Topic

    The default location of the splitter bar is 100 pixels from the left for a vertical split and 100 pixels from the top for a horizontal split. You can adjust the initial location of the splitter bar using the C1Splitter.SplitterDistance property. In this topic, you will learn how to set the C1Splitter.SplitterDistance property in Design view, in Source view, and in code.

    In Design View

    Complete the following steps:

    1. Add C1Splitter to the Web form.
    2. Right-click the control and select Properties.
    3. In the Properties window, locate the C1Splitter.SplitterDistance property and specify a number to represent the location of the splitter bar from the left edge of the splitter bar. For this example, we'll set it to "250".
    4. Run the program.

    In Source View

    To set the splitter bar location, place SplitterDistance="250" within the <cc1:C1Splitter> tag. Once the C1Splitter.SplitterDistance property has been set, the markup will resemble the following:

    <cc1:C1Splitter ID="C1Splitter1" runat="server" SplitterDistance="250">

    In Code

    Complete the following steps:

    1. Import the following namespace into your project:

      To write the code in Visual Basic:

        
      Visual Basic
      Copy Code
      Imports C1.Web.Wijmo.Controls.C1Splitter

      To write the code in C#:

        
      C#
      Copy Code
      using C1.Web.Wijmo.Controls.C1Splitter;
             
    2. Add the following code to the Page_Load event to set the C1Splitter.SplitterDistance property:              

      To write the code in Visual Basic:

        
      Visual Basic
      Copy Code
      C1Splitter1.SplitterDistance = 250

      To write the code in C#:

        
      C#
      Copy Code
      C1Splitter1.SplitterDistance = 250;
    3. Run the program.
       

    This Topic Illustrates the Following:

    The following image depicts a C1Splitter with a splitter set 50 pixels from the left side of the control:

     

    See Also